<template>
  <div class="home">
    <SearchBar />
    <ServiceCards />
    <NewsList />
    <ProcurementList />
    <div class="category-section">
      <h2 class="category-title">专区分类</h2>
      <div class="category-cards">
        <div class="category-row">
          <el-card class="category-card" shadow="hover" v-for="(category, index) in categoriesRow1" :key="index">
            <div class="category-content">
              <i :class="category.icon"></i>
              <div class="category-name">{{ category.name }}</div>
            </div>
          </el-card>
        </div>
        <div class="category-row">
          <el-card class="category-card" shadow="hover" v-for="(category, index) in categoriesRow2" :key="index">
            <div class="category-content">
              <i :class="category.icon"></i>
              <div class="category-name">{{ category.name }}</div>
            </div>
          </el-card>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup>
import SearchBar from '@/components/SearchBar.vue'
import ServiceCards from '@/components/ServiceCards.vue'
import NewsList from '@/components/NewsList.vue'
import ProcurementList from '@/components/ProcurementList.vue'


const categoriesRow1 = [
  { name: '专家资格培训专区', icon: 'el-icon-school' },
  { name: '大众健身指导专区', icon: 'el-icon-user' },
  { name: '体育赛事服务专区', icon: 'el-icon-trophy' }
]

const categoriesRow2 = [
  { name: '场馆设施建设专区', icon: 'el-icon-office-building' },
  { name: '美术创作评价专区', icon: 'el-icon-picture' },
  { name: '非物质文化专区', icon: 'el-icon-collection' }
]

</script>

<style scoped>
.category-section {
  max-width: 1200px;
  margin: 40px auto;
  padding: 0 20px;
}

.category-title {
  text-align: center;
  margin-bottom: 30px;
  font-size: 24px;
  color: #333;
  position: relative;
}

.category-title::after {
  content: '';
  display: block;
  width: 50px;
  height: 3px;
  background-color: #409eff;
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
}

.category-cards {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.category-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.category-card {
  flex: 1;
  cursor: pointer;
  transition: all 0.3s;
}

.category-card:hover {
  transform: translateY(-5px);
}

.category-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 30px 0;
}

.category-content i {
  font-size: 40px;
  color: #409eff;
  margin-bottom: 15px;
}

.category-name {
  font-size: 16px;
  color: #333;
}
</style>
